require 'paypal-sdk-<%= service_name.gsub("_", "") %>'
@api = PayPal::SDK::<%= service_name.camelize %>::API.new( :device_ipaddress => "127.0.0.1" )

# Build request object
@<%= service_action %> = @api.build_<%= service_action %>(<%= format_hash(request_hash).html_safe %>)

# Make API call & get response
@<%= service_action %>_response = @api.<%= service_action %>(@<%= service_action %>)

# Access Response
if @<%= service_action %>_response.success?
<% api_response.members.keys.each do |name| -%>
  <% unless [:xmlns, :type, :responseEnvelope, :error].include? name -%>
  @<%= service_action %>_response.<%= name %>
  <% end %>
<% end -%>
else
  @<%= service_action %>_response.error
end
